package com.example.base.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import androidx.viewbinding.ViewBinding
import com.example.base.adapter.holder.RVHolder
import com.example.base.adapter.holder.VBHolder
import com.example.base.base.util.inflateBindingWithGeneric

/**
 *  使用viewBind 的 adapter
 *  具有生命周期管理
 */
open class VbAdapter<T, VB: ViewBinding> : LifecycleAdapter<T,VBHolder<VB>>(-1){

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VBHolder<VB> {
        return VBHolder(inflateBindingWithGeneric(parent), onItemTouchEventListener)
    }
}

